package com.qijian.business.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.business.domain.KrWorkOrder;
import com.qijian.business.domain.ProductionDetail;
import com.qijian.business.domain.ProductionDetailSalary;
import com.qijian.business.domain.query.KrWorkOrderQuery;
import com.qijian.business.domain.query.ProductionDetailQuery;
import com.qijian.business.domain.vo.ProductionDetailVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * 报工Mapper接口
 *
 * @author qijian
 * @date 2025-03-25
 */
public interface ProductionDetailMapper extends BaseMapper<ProductionDetail> {

    @Select("select count(0) from production_detail WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    Page<ProductionDetailVo> getPageVo(Page<ProductionDetail> page, QueryWrapper<ProductionDetailQuery> query);


    Page<ProductionDetailVo> pageListSalary(Page<ProductionDetail> page, @Param(Constants.WRAPPER) QueryWrapper<ProductionDetailQuery> queryWrapper);

    Page<ProductionDetailVo> pageListMoonSalary(Page<ProductionDetail> page, @Param(Constants.WRAPPER) QueryWrapper<ProductionDetailQuery> queryWrapper);

    List<ProductionDetailVo> pageListMoonSalary2(@Param("createTime") String createTime ,@Param("userId") Long userId);
}
